/**
 * 
 */
package tp8.tsh.commands.intf;

import java.util.List;
import java.util.Map;

import tp8.tsh.cli.CurrentDirectory;
import tp8.tsh.cli.TSHOutput;
import tp8.tsh.exc.TSHException;

/**
 * @author tpana
 * 
 */
public interface Command {

	/**
	 * Sets the {@link TSHOutput} to use for displaying messages to the user.
	 * 
	 * @param tshOutput
	 *            The {@link TSHOutput}.
	 */
	public void setTSHOutput(TSHOutput tshOutput);

	/**
	 * @return The official name of the command.
	 */
	public String getName();

	/**
	 * @return The command's version.
	 */
	public String getVersion();

	/**
	 * @return A map with the Command's aliases and the commands to pass as the
	 *         respective value. If no commands should be auto-appended the
	 *         value should be null.
	 */
	public Map<String, String> getAliasMap();

	/**
	 * @return A list with the regular expressions for the possible argument
	 *         combinations expected.
	 */
	public List<String> getArgsRegEx();

	/**
	 * Executes the command.
	 * 
	 * @param args
	 *            The arguments passed from the CLI.
	 * @param curDir
	 *            The current directory.
	 * @param envVars
	 *            The environment variables.
	 * @throws TSHException
	 */
	public void execute(String[] args, CurrentDirectory curDir,
			Map<String, String> envVars) throws TSHException;

}
